# Copyright (C) 2010-2019 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenQuake is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake.  If not, see <http://www.gnu.org/licenses/>.

[distribution]
oq_distribute = zmq
# make sure workers are terminated when tasks are revoked
terminate_workers_on_revoke = true
serialize_jobs = 1

[memory]
# above this quantity (in %) of memory used a warning will be printed
soft_mem_limit = 90
# above this quantity (in %) of memory used the job will be stopped
# use a lower value to protect against loss of control when OOM occurs
hard_mem_limit = 98

[dbserver]
file = {{ workdir_services }}/oqdata/db.sqlite3
# daemon bind address; must be a valid IP address
# example: 0.0.0.0
listen = {{ server_host }}
# address of the dbserver; can be an hostname too
# on multi-node cluster it must be the IP or hostname
# of the master node (on the master node cfg too)
# example: master.hpc
host = {{ server_host }}
# port 1908 has a good reputation:
# https://isc.sans.edu/port.html?port=1908
port = 1908
# port range used by workers to send back results
# to the master node
receiver_ports = 1921-1930
authkey = changeme

[webapi]
server = "http://{{ server_host }}:8800"
username =
password =

[zworkers]
host_cores =
ctrl_port = 1909

[directory]
# the base directory containing the <user>/oqdata directories:
# if set, it should be on a shared filesystem; this is **mandatory** on a multi-node cluster
# if not set, the oqdata directories go into $HOME/oqdata,
# unless the user sets his own OQ_DATADIR variable
shared_dir = {{ shared_nfs }}
# a custom path where to store temporary data; on Linux systems by default
# temporary files are stored in /tmp, but on HPC and cloud systems the
# drive containing the root fs is usually quite small
# path must exists otherwise default $TMPDIR will be used as fallback
custom_tmp =
